package voice;

import java.util.Calendar;

/**
 * Implements ID for voice messages
 * @author Alexandre, Cristovao, Raul, Rodolpho, Tales
 * @version 1.1
 */
public class VoiceMessageIdentification {

	private String from;
	private String to;
	String date;
	String time;

	/**
	 * Constructor of the class.
	 * @param from who send the voice message
	 * @param to who receive the voice message
	 * @param date when the message was sent
	 * @param time when the message was sent
	 */
	public VoiceMessageIdentification(String from, String to, String date, String time) {
		this.from = from;
		this.to = to;
		this.date = date;
		this.time = time;
	}

	/**
	 * Get who send the message
	 * @return user
	 */
	public String getFrom() {
		return from;
	}

	/**
	 * Get who receive the message
	 * @return user
	 */
	public String getTo() {
		return to;
	}

	/**
	 * Get the hour when the message was sent 
	 * @return hour
	 */
	public String getTime() {
		return time;
	}
	
	/**
	 * Get the date when the message was sent 
	 * @return date
	 */
	public String getDate() {
		return date;
	}

	/**
	 * Return the name of the file in format: [ name1-name2_dd.mm.aaaa.HH.MM.SS.milisecs ].wav 
	 * @return the filename
	 */
	public String getFileName() {
		//format type: name1-name2_30.11.2009.20.34.55.210.wav
		String newTime = getTime().replace(":", ".");
		return getFrom() + "-" + getTo() + "_" + getDate() + "." + newTime + ".wav";
	}

}
